package hao.d0313;

import java.util.Scanner;

public class Rectangle extends Shape{

    @Override
    double area() {
        return length*widght;
    }
    @Override
    double perimeter() {
        return 2*(length+widght);
    }

    public static void main(String[] args) {
        Rectangle rectangle = new Rectangle();
        System.out.println("请输入矩形的长和宽：");
        Scanner input = new Scanner(System.in);
        length = input.nextInt();
        widght = input.nextInt();
        System.out.println("周长："+rectangle.perimeter());
        System.out.println("面积："+rectangle.area());
    }
}

